function getScreenSize() {
    var w = window,
        d = document,
        e = d.documentElement,
        g = d.getElementsByTagName('body')[0],
        x = w.innerWidth || e.clientWidth || g.clientWidth,
        y = w.innerHeight|| e.clientHeight|| g.clientHeight;
    alert(x);
}

function wndsize(){
    var w = 0;var h = 0;
//IE
    if(!window.innerWidth){
        if(!(document.documentElement.clientWidth == 0)){
            //strict mode
            w = document.documentElement.clientWidth;h = document.documentElement.clientHeight;
        } else{
            //quirks mode
            w = document.body.clientWidth;h = document.body.clientHeight;
        }
    } else {
        //w3c
        w = window.innerWidth;h = window.innerHeight;
    }
    return {width:w,height:h};
}

function wndcent(){
    var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0};
    var _x = 0;var _y = 0;var offsetX = 0;var offsetY = 0;
//IE
    if(!window.pageYOffset){
//strict mode
        if(!(document.documentElement.scrollTop == 0)){offsetY = document.documentElement.scrollTop;offsetX = document.documentElement.scrollLeft;}
//quirks mode
        else{offsetY = document.body.scrollTop;offsetX = document.body.scrollLeft;}}
//w3c
    else{offsetX = window.pageXOffset;offsetY = window.pageYOffset;}_x = ((wndsize().width-hWnd.width)/2)+offsetX;_y = ((wndsize().height-hWnd.height)/2)+offsetY;
    return{x:_x,y:_y};
}









